package containerlogistik.implementation;

import containerlogistik.interfaces.*;

public class PalletImpl extends AbstractPallet {

    private final Mass mass;
    
    private PalletImpl(Mass mass, BoundingBox boundingBox){
        this.mass = mass;
        this.boundingBox = boundingBox;
    }

    static Pallet valueOf(Mass mass, BoundingBox boundingBox) {
        return new PalletImpl(mass, boundingBox);
    }
    
    @Override
    public Mass mass() {
        return this.mass;
    }

    @Override
    public boolean isFree() {
        return false;
    }

    @Override
    public boolean isBlocked() {
        return false;
    }

    @Override
    public boolean isOccupied() {
        return true;
    }

    @Override
    public int compareTo(Pallet o) {
        return Double.compare(this.mass().kg(), o.mass().kg());
    }
}
